package com.shou.types.exception;

import com.shou.types.common.ReturnCodeEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * ClassName:DataNotFoundException
 * Project:SmartPark
 * Package: com.shou.types.exception
 * Description
 *
 * @Author Nemo
 * @Create 2025/2/17 22:25
 * @Version 1.0
 */
public class DataNotFoundException extends BusinessException{
    @Getter
    @AllArgsConstructor
    public enum ErrorCodeEnum {
        USER_NAME_NOT_FOUND("B-CLI-01-01", "用户名不存在！"),
        USER_INFO_NOT_FOUND("B-CLI-01-02", "用户记录不存在！"),
        LOT_INFO_NOT_FOUND("B-CLI-01-03", "停车场记录不存在！"),
        INFO_NOT_FOUND("B-CLI-01-05", "记录不存在！"),
        SPACE_INFO_NOT_FOUND("B-CLI-01-04", "停车位记录不存在！"),
        NO_INFO_NEED_CLEAR("B-CLI-02-01", "未查询到将要删除的信息！");

        private final String errorCode;
        private final String message;
    }
    public DataNotFoundException(DataNotFoundException.ErrorCodeEnum errorCodeEnum, ReturnCodeEnum httpStatus) {
        super(errorCodeEnum.getErrorCode(), errorCodeEnum.getMessage(), httpStatus);
    }
    public DataNotFoundException(DataNotFoundException.ErrorCodeEnum errorCodeEnum, String description, ReturnCodeEnum httpStatus) {
        super(errorCodeEnum.getErrorCode(), errorCodeEnum.getMessage() + description, httpStatus);
    }
}
